<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .father{
            width: 200px;
            height: 200px;
            background: red;
        }
        .son{
            width: 100px;
            height: 100px;
            background: blue;
        }
    </style>
    <script src="../node_modules/jquery/dist/jquery.js"></script>
</head>
<body>
<script>
     $(function () {
         /**
          * mouseover/mouseout事件,子元素被移出,也会触发父元素
          */
         /**
        $(".father").mouseover(function () {
            console.log("father被移入了");
        });
        $(".father").mouseout(function () {
            console.log("father被移出了");
        });*/

         /**
          * mouseenter/mouseleave事件,子元素被移出,不会触发父元素
          */
            /**
         $(".father").mouseenter(function () {
             console.log("father被移入了");
         });
         $(".father").mouseleave(function () {
             console.log("father被移出了");
         });*/
            // $(".father").hover(function () {
            //     console.log("father被移入了");
            // },function () {
            //     console.log("father被移出了");
            // });

         $(".father").hover(function () {
             console.log("father被移入移出了");
         });
     });
</script>

<div class="father">
    <div class="son"></div>
</div>
</body>
</html>